home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_066 / nart / rotate.s < prev   
Text File  |  1992-05-06  |  910b  |  61 lines

  1. *\  :ts=8 bk=0
  2. * The color rotater for the New Art program.
  3. * This was written in machine code for speed (Lattice has this odd habit
  4. * of pessimizing code).
  5. *
  6. * Calling convention:
  7. *  rotate ();
  8. *
  9. * Assembling:
  10. *  df1:c/assem rotate.s -i df1:include -o rotate.o
  11. *
  12. * 8607.1
  13. */
  14.  
  15.         include    "exec/types.i"
  16.         include    "exec/libraries.i"
  17.         include "graphics/view.i"
  18.  
  19. xlib        macro
  20.         xref    _LVO\1
  21.         endm
  22.  
  23. callsys        macro
  24.         CALLLIB    _LVO\1
  25.         endm
  26.  
  27.         xdef    _rotate
  28.  
  29.         xref    _GfxBase
  30.         xref    _vp
  31.  
  32.         xlib    LoadRGB4
  33.  
  34.         rorg    0
  35.  
  36.  
  37. _rotate        movem.l    a2-a3/a6,-(sp)
  38.  
  39.         movea.l    _vp,a0
  40.         movea.l a0,a1
  41.         movea.l vp_ColorMap(a1),a1
  42.         movea.l cm_ColorTable(a1),a1
  43.         movea.l a1,a2
  44.         adda.w    #1*2,a2        Point at the colors we want
  45.         movea.l    a2,a3
  46.         addq.w    #2,a3
  47.         moveq    #13,d0
  48.         move.w    (a2),d1
  49. loop        move.w    (a3)+,(a2)+
  50.         dbra    d0,loop
  51.         move.w    d1,(a2)
  52.  
  53.         movea.l    _GfxBase,a6
  54.         moveq    #32,d0
  55.         callsys    LoadRGB4
  56.  
  57.         movem.l    (sp)+,a2-a3/a6
  58.         rts
  59.  
  60.         end
  61.